<layout name="Index/layout" />
<div class="box-form form-edit">
    <div class="tit">
	    <ul class="float">
	        <li><a href="{:U('index')}" >文章列表</a></li>
	        <li><a href="{:U('add')}" >添加文章</a></li>
	    </ul> 
    </div>
    <div class="con form-edit">
        <form class="AjaxForm" data-action="{:U()}" method="post">
            <div class="span-right">
			<table class="bordered color">
			    <tr>
			        <th>
			            综合设置
			        </th>
			    </tr>
			    <tr>
			    	<td>缩略图</td>
			    </tr>
			    <tr>
			    	<td class="tc">
			    		{:W('Uploader/img',array('thumb',$info['thumb']))}
			    	</td>
			    </tr>
			    <tr>
			    	<td>发布时间</td>
			    </tr>
			    <tr>
			    	<td class="tc">
			    		{:W('Datetime/dateTime',array('add_time',$info['add_time']))}
			    	</td>
			    </tr>
				<tr>
					<td>阅读量</td>
				</tr>
				<tr>
					<td>
						<input type="text" name="view" size="10" value="{$info.view}">
					</td>
				</tr>
				<tr>
					<td>排序</td>
				</tr>
				<tr>
					<td>
						<input type="text" name="sort" size="10" value="{$info.sort}">
					</td>
				</tr>
			</table>
            </div>

			<div class="span-left">
            <table class="bordered color">
			    <tr>
			        <th colspan="2">
			            编辑文章
			            <input type="hidden" name="id" value="{$info.id}">
			        </th>
			    </tr>
				<tr>
					<td>栏目:</td>
					<td>
			            <select name="cid">
			            <foreach name="cate_tree" item="v">
			            	<option value="{$v.id}" <eq name="v.is_menu" value="1">disabled</eq> <eq name="info.cid" value="$v['id']">selected</eq> >{$v.mark}{$v.title}</option>
			            </foreach>
			            </select>
					</td>
				</tr>
				<tr>
					<td>标题:</td>
					<td>
						<input type="text" name="title" datatype="require" tip="标题(25个字至50个字节以内)" value="{$info.title}">
					</td>
				</tr>
				<tr>
					<td width="10%">内容:</td>
					<td width="90%">
						{:W('Ueditor/editor',array('content',$info['content']))}
					</td>
				</tr>
				<tr>
					<td>标签:</td>
					<td>
						{:W('Chosen/many',array('tag',$info['tag'],$tag))}
					</td>
				</tr>
				<tr>
					<td>关键词:</td>
					<td>
						<input type="text" name="keywords" tip="关键词(5个词左右,单个词8汉字以内),若留空自动截取文章的关键词." value="{$info.keywords}">
					</td>
				</tr>
				<tr>
					<td>描述:</td>
					<td>
						<textarea name="description" style="width:99%" tip="描述(字数80个汉字，160个字符以内),若留空自动截取文章的前160个字符.">{$info.description}</textarea>
					</td>
				</tr>
                <tr>
                    <td colspan="2"><input type="submit" class="btn-big btn-blue" style="margin-left:10%" value="提交"></td>
                </tr>
            </table>
            </div>

        </form>
    </div>
</div>

<script type="text/javascript">

// $(window).bind('beforeunload', function(){
// 	parent.iframe.removeClass('hide');
// 	return "确认离开将不会保存当前数据。";
// });

seajs.use(['ajax'],function(ajax){
    ajax.get();
    ajax.confirm();
    ajax.html();
    ajax.valid();
});
</script>